home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / asm / ibmasm.doc < prev    next >
Text File  |  1985-01-07  |  11KB  |  291 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.    1: Sample Assembler Programs               11-11-1983 IBM
  9. At this time there are two sample programs in assembler available for
  10. downloading.  They are INTRPT.ASM and VDISK.ASM.  The first is used by
  11. the Pascal program SAMPLES.PAS to execute DOS interrupts.  It shows how
  12. to establish the linkage from Pascal to Assembler.
  13.   The second is the sample device driver from the DOS 2.00 manual.  It
  14. creates a 180KB virtual diskette drive in memory.
  15.   To get either program, use the <F>iles command.
  16. The next message is:
  17.    2: Processing Tab Characters               05-08-1984 ROBERT BECKLEY
  18. <R>ead, <N>ext, or <Q>uit? R
  19. (This message was re-printed from the May issue of EXCHANGE)
  20.  
  21.                        Robert H. Beckley
  22.                 Manassas Personal Computer Club
  23.  
  24. Some editors, like the Personal Editor, compress blanks out of text
  25. files before storing those files onto the diskette.  This helps shorten
  26. the files and thus provide more free diskette space.  However, it adds
  27. an additional burden to any program that wants to process the files.  In
  28. working on my own word processor, BEEPER, I added an assembly language
  29. routine that would expand the tabs back to the original blanks.  I will
  30. share that Assembly Language program and a sample Pascal test program
  31. with you here.
  32.  
  33. A tab character is a special ASCII code that is inserted in a file to
  34. replace up to eight blanks.  The tabs are set for columns 8, 16, 24, and
  35. so forth.  If there are more than eight blanks in a row, multiple tab
  36. characters may be inserted into the text.  The algorithm for determining
  37. the number of blanks to insert to expand the tab is:
  38.  
  39.     Number of blanks to insert =
  40. MORE...<C>ontinue or <Q>uit?RPlease strike one of these letters: <C>, <Q>.
  41.     8 - (COL mod 8)
  42.  
  43.     Examples:
  44.     If tab char is in col 1, then insert 7 blanks
  45.     If tab char is in col 2, then insert 6 blanks
  46.     If tab char is in col 7, then insert 1 blank
  47.     If tab char is in col 10,then insert 6 blanks
  48.  
  49. The Assembly Language procedure that expands the tabs is shown on the
  50. following page.  It can be called from a Pascal program.  Two parameters
  51. are passed; both are variable length strings.  The first is the original
  52. line which may or may not include tabs, and the second is the resulting
  53. string with tabs expanded to blanks.  The second string must have enough
  54. space for the maximum length line that can result.  The program sets the
  55. output string length to zero (a null string) if the input line is null
  56. or is all blank.  I did this because that is what I needed in BEEPER.
  57. The program is documented, and I will leave it to the reader to learn it
  58. from the listing.
  59.  
  60. The program can be assembled with the Macro Assembler, resulting in
  61. object file that can be linked with the Pascal program which calls the
  62. EXPAND_TABS routine.  A test Pascal program illustrates that tab
  63. expansion is provided.  TEST shows how the Assembly Language is
  64. referenced from Pascal.  An attribute of EXTERN is attached to the
  65. EXPAND_TABS procedure to allow the compiler to resolve calls to the
  66. procedure.  TEST can then be compiled to produce TEST.OBJ.  TEST.OBJ can
  67. be linked with the object produced by the Assembler to produce an
  68. executable TEST.EXE file.
  69.  
  70.  
  71.     Assemble ENABLE.ASM --> ENABLE.OBJ
  72.  
  73.     Compile TEST.PAS --> TEST.OBJ
  74.  
  75.     Link LINK TEST+ENABLE; --> TEST.EXE
  76.  
  77. The TEST program assumes there is a file on the default drive called
  78. TEST.TXT.  This file should contain text containing tab characters
  79. (e.g., a file stored under Personal Editor without invoking the NOTABS
  80. option).  The file is read, one line at a time, and each line is passed
  81. to the EXPAND_TABS routine.  The results are shown on the screen:
  82.  
  83.     Length of the original string
  84.     The expanded original string
  85.     The original string with "@"
  86.       displayed for each tab char
  87.     ======== Call EXPAND_TABS =======
  88.     Length of the resulting string
  89.     The resulting string
  90.  
  91. This shows the tabs in the original string by displaying them as "@"
  92. characters.  The resulting string, which shows that the tabs were
  93. expanded properly, should be equal to the expanded original string
  94. (which DOS has properly expanded to display it).  The TEST can be used
  95. to ensure that the above assemble and link steps where done correctly.
  96. I hope this routine will be useful for the those who need to expand tabs
  97. in text lines within a program.
  98.  
  99. [Download EXPNDTAB.ASM and TESTTAB.PAS.]
  100. The next message is:
  101.    3: IBM Macro Assembler Version 2.00        08-14-1984 ANNOUNCEMENTS
  102. <R>ead, <N>ext, or <Q>uit? C
  103. Please strike one of these letters: <N>, <R>, <Q>.
  104. <R>ead, <N>ext, or <Q>uit? R
  105.  
  106.    The IBM  Macro Assembler Version 2.00  is available for purchase  as a
  107.    software product.  It includes a non-macro  (Small) and a macro assem-
  108.    bler to allow  you to prepare programs for the  IBM Personal Computer.
  109.    Additionally a Library  Manager, Large Linker and  a structured assem-
  110.    bler pre-processor are supplied with the Macro Assembler.
  111.  
  112.    Assembler-produced programs may be called  from Basic, Fortran, Pascal
  113.    and Cobol  compiled programs.   You may  create an  assembler language
  114.    program by  using the text  editing capability  of DOS.  Then  use the
  115.    Macro Assembler to assemble the program.
  116.  
  117.    Assembler-produced programs  provide the ability  to control  the per-
  118.    sonal computer at a detailed level not available with other languages.
  119.  
  120.  
  121.  
  122.    HIGHLIGHTS
  123.    __________
  124.  
  125.  
  126.    o   Macro capability
  127.  
  128.    o   Supports full instruction set of the Personal Computer
  129.  
  130.    o   Supports 80286 (non-protect mode) instruction set
  131.  
  132.    o   Supports the 8087/80287 math co-processor
  133.  
  134.    o   Provides a Structured Assembler Pre-processor
  135.  
  136.    o   Provides a Library Manager
  137.  
  138.    o   Provides a Large Linker (up to 1MB)
  139.  
  140.    o   Provides 8087/80287 data format conversion routines
  141.  
  142.        -   To/from ASCII
  143.  
  144.        -   To/from the  Microsoft data formats  used by the  IBM Personal
  145.            Computer Basic Interpreter, Basic  Compiler/1.00, Fortran Com-
  146.            piler/1.00, and Pascal Compiler/1.00.
  147.  
  148.    o   Provides a cross-reference facility to aid in debugging
  149.  
  150.    o   Provides a set of pseudo operations to simplify coding
  151.  
  152.  
  153.    RELATIONSHIP TO PRIOR VERSION
  154.    _____________________________
  155.  
  156.  
  157.    The following enhancements  are part of Version 2.00  relative to Ver-
  158.    sion 1.00.
  159.  
  160.    o   Support for the 80286 (non-protect mode) instruction set
  161.  
  162.    o   Support for the 8087/80287 math co-processor
  163.  
  164.    o   Data conversion routines
  165.  
  166.    o   Large Linker
  167.  
  168.    o   Library Manager
  169.  
  170.    o   Structured Assembler Pre-processor
  171.  
  172.    o   Maintenance and restriction removals
  173.  
  174.  
  175.  
  176.    INSTALLATION/OPERATION
  177.    ______________________
  178.  
  179.  
  180.    It is the user responsibility to install the Macro Assembler using the
  181.    guidelines   provided   in   the    Macro   Assembler   documentation.
  182.    Instructions for invoking the Macro Assembler and writing programs are
  183.    combined in the Macro Assembler documentation.
  184.  
  185.  
  186.  
  187.    PACKAGING
  188.    _________
  189.  
  190.  
  191.    The  assemblies  and  their  related utilities  are  packaged  on  one
  192.    dual-sided eight-sector diskette.   The diskette is packaged  with the
  193.    Macro Assembler Reference manual.
  194.  
  195.    The Macro  Assembler modules can be  placed on two  single-sided disk-
  196.    ettes by  copying the first  6 files onto  the first diskette  and the
  197.    remaining files onto the second diskette.
  198.  
  199.  
  200.  
  201.    PUBLICATIONS
  202.    ____________
  203.  
  204.  
  205.    This product is described in:
  206.  
  207.    o   The IBM Personal Computer Macro Assembler manual.  (Two Volumes)
  208.  
  209.    PREREQUISITES
  210.    _____________
  211.  
  212.  
  213.    The Macro Assembler  requires DOS 1.1 or later.   The Macro Assembler,
  214.    version 2.0, requires 96K of memory with DOS 1.1, or 128K with DOS 2.0
  215.    or higher.   The Macro  Assembler requires  at least  one double-sided
  216.    diskette drive.  A  printer and an 80-column  display are recommended.
  217.    The Macro Assembler will operate on any IBM PCjr, IBM Personal Comput-
  218.    er, IBM  Personal Computer XT, IBM  Portable Personal Computer  or IBM
  219.    Personal Computer AT wh